<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" lang="zh">
<head>
    <th:block th:include="include :: header('医废车列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse none">
                <div id="formId">
                    <div class="select-list">
                        <ul>
                          <!--  <li>
                                <p>处置公司id：</p>
                                <input type="text" name="disposalId"/>
                            </li>-->
                            <li>
                                <p>车牌号：</p>
                                <input type="text" name="truckLicencePlate"/>
                            </li>
                           <!-- <li>
                                <p>医废车类型：</p>
                                <select name="truckType" th:with="type=${@dict.getType('')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <p>状态：</p>
                                <select name="status">
                                    <option value="">所有</option>
                                </select>
                            </li>
                            <li>
                                <p>创建者 sys_user表：</p>
                                <input type="text" name="createId"/>
                            </li>
                            <li>
                                <p>更新者 sys_user表：</p>
                                <input type="text" name="updateId"/>
                            </li>-->
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="yf:truck:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="yf:truck:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="yf:truck:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="yf:truck:export">
                    <i class="fa fa-download"></i> 导出
                 </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
     <script th:src="@{/js/qrcode.min.js}" ></script>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('yf:truck:edit')}]];
        var removeFlag = [[${@permission.hasPermi('yf:truck:remove')}]];
        var prefix = ctx + "yf/truck";
        var qcode = [[${@permission.hasPermi('yf:truck:view')}]]
        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "医废车",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'truckId', 
                    title : '医废车id',
                    visible: false
                },
                /*    {
                        field: 'disposalId',
                        title: '处置公司id'
                    },*/
                {
                    field : 'deptName',
                    title : '处置公司'
                },
                {
                    field : 'truckLicencePlate', 
                    title : '车牌号'
                },
                {
                    field : 'dictTruckType',
                    title : '医废车类型'
                },
                {
                    field : 'dictLabel',
                    title : '状态'
                },
              /*  {
                    field : 'createId', 
                    title : '创建者 sys_user表'
                },
                {
                    field : 'updateId', 
                    title : '更新者 sys_user表'
                },*/
             /*   {
                    field : 'remark', 
                    title : '备注'
                },*/
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<button type="button" class="btn btn-info btn-xs ' + qcode + '"  data-toggle="modal" data-target="#myModal6" onclick="$.department.preQRcode(\'' + row.truckLicencePlate + '\',\'' + row.truckId + '\');"><i class="fa fa-qrcode"></i>二维码</button> ');
                        actions.push('<button type="button" class="btn btn-info btn-xs ' + qcode + '"   onclick="$.department.downQRcode(\'' + row.truckLicencePlate + '\',\'' + row.truckId + '\');"><i class="fa fa-download"></i>二维码</button> ');
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.truckId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.truckId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>